package com.tebiecloud.api.gateway.server.fallback;

import com.tebiecloud.common.constants.ResultEnum;
import com.tebiecloud.common.model.ResultBody;
import com.tebiecloud.common.utils.ResultBodyUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Mono;

/**
 * 响应超时熔断处理器
 * @Author: tebie
 * @Date: 2019-08-09 08:55
 */
@RestController
public class FallbackController {

    @RequestMapping("/fallback")
    public Mono<ResultBody> fallback() {
        return Mono.just(ResultBodyUtils.build(ResultEnum.GATEWAY_TIMEOUT.getCode(), "访问超时，请稍后再试!"));
    }

}
